import { useState } from "react";
import { useEffect } from "react";
import { useLayoutEffect } from "react";

function Hooks(){
    let [num,setNum] = useState(0)
    useLayoutEffect(()=>{
        console.log("哈哈哈哈")
        console.log(document.querySelector("h1"))
        setNum((num)=>num+1)
    },[])
    useEffect(()=>{
        console.log("嘿嘿黑")
        setNum((num)=>num+1)
    },[])
    return(
        <div>
            <h1>useLayoutEffect---{num}</h1>
        </div>
    )
}

export default Hooks;